import os
import cv2
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from matplotlib import pyplot
import numpy as np
import random

jpg_dir = '/home/xys/paper/ReID/data_vehicle_test/bounding_box_test(副本)/'
files = os.listdir(jpg_dir)
x = []
num_x = 0
y = []
num_y = 0
for file in files:
    img = cv2.imread(jpg_dir+file)
    w, h, _ = img.shape
    num_x = num_x + w
    num_y = num_y + h
    x.append(w)
    y.append(h)
num = len(x)
center = (num_x/num, num_y/num)
print(center)
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)
ax1.set_title('size')
	# 设置横坐标名称
ax1.set_xlabel('w')
	# 设置纵坐标名称
ax1.set_ylabel('h')
	# 画散点图
ax1.scatter(x, y,  c='k', marker='.')
plt.show()
